tests: Test that local pulls do not use deltas
authorDan Nicholson <nicholson@endlessm.com>
Tue, 9 Aug 2016 22:41:36 +0000 (15:41 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 10 Aug 2016 10:54:46 +0000 (10:54 +0000)
Pulls from local repos now default to disabling static deltas so that
objects are copied. To check this is the case, see if the object files
are hardlinked after pulling.

Closes: #447
Closes: #448
Approved by: cgwalters

tests/test-local-pull.sh

index a9ac1278e7eea1ff22b411d9eacda1f6352fdb79..9e8c8a001258643d2e9d0ef9aff104f4c570c02a 100755 (executable)
@@ -26,7 +26,7 @@ unset OSTREE_GPG_HOME
 
 skip_without_user_xattrs
 
-echo "1..7"
+echo "1..8"
 
 setup_test_repository "archive-z2"
 echo "ok setup"
@@ -95,3 +95,13 @@ ${OSTREE} summary -u update --gpg-sign=${TEST_GPG_KEYID_1} --gpg-homedir=${TEST_
 ${CMD_PREFIX} ostree --repo=repo6 pull-local --remote=origin --gpg-verify-summary repo test2 2>&1
 
 echo "ok --gpg-verify-summary"
+
+mkdir repo7
+${CMD_PREFIX} ostree --repo=repo7 init --mode="archive-z2"
+${CMD_PREFIX} ostree --repo=repo7 pull-local repo
+${CMD_PREFIX} ostree --repo=repo7 fsck
+for src_object in `find repo/objects -name '*.filez'`; do
+    dst_object=${src_object/repo/repo7}
+    assert_files_hardlinked "$src_object" "$dst_object"
+done
+echo "ok pull-local z2 to z2 default hardlink"